﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace nwrole.SuperModule.service.Models
{
    public class ModuleStatusDto
    {
        public string ModuleName { get; set; }
        public string ServiceName { get; set; }
        public string LastPulseMessage { get; set; }
        public DateTime? LastPulseUtc { get; set; }
        public string Status { get; set; }

        public ModuleStatusDto()
        {
        }

        public ModuleStatusDto(SuperModule.ModuleInfo moduleInfo)
        {
            ModuleName = moduleInfo.Name;
            ServiceName = moduleInfo.ServiceName;
            LastPulseMessage = moduleInfo.LastPulseMessage;
            LastPulseUtc = moduleInfo.LastPulseUtc;
            Status = moduleInfo.Status.HasValue ? moduleInfo.Status.ToString() : "Not installed";
        }
    }
}
